package cn.iocoder.springboot.lab03.kafkademo.service;

import cn.iocoder.springboot.lab03.kafkademo.enums.Events;
import cn.iocoder.springboot.lab03.kafkademo.enums.States;
import org.springframework.boot.CommandLineRunner;
import org.springframework.statemachine.StateMachine;

import javax.annotation.Resource;

/**
 * @Author：YH
 * @Description：
 * @Date:Created in 2023/12/23 11:16
 */
public class StateMachineStart implements CommandLineRunner {
    @Resource
    private StateMachine<States, Events> stateMachine;

    @Override
    public void run(String... args) throws Exception {
        stateMachine.sendEvent(Events.E1);
        stateMachine.sendEvent(Events.E2);
    }
}
